import { SHA256 } from 'crypto-js';

/**
 * Encrypt the plain text to hash code, using SHA-256 algorithm.
 * @param text plain text to encrypt
 * @returns encrypted data, a 64-character string
 */
function encryptSha256(text: string): string {
  const hash = SHA256(text);
  return hash.toString();
}

export { encryptSha256 };
